function content0LoadFunction() {
	if ($('fileList').innerHTML == '') {
		filesViewObj.getFiles();	
	}
}	

var filesViewObj = {
	getFiles : function() {
		x_getFiles(this.returnGetFiles);	
	},
	returnGetFiles : function (string) {
		$('fileList').innerHTML = string;
	},
	viewFilesByCat : function (catID) {
		var containerDiv = 'fileList'+catID;
		if ($(containerDiv).style.display == 'none') {
			new Effect.SlideDown(containerDiv, {direction: 'top', duration: .3});
			$('mainCatHeading'+catID).className = 'arrowUp';
		} else {
			new Effect.SlideUp(containerDiv, {direction: 'top', duration: .3});
			$('mainCatHeading'+catID).className = 'arrowDown';
		}
	},
	refreshFileList : function (catID,subCatID) {
		x_refreshFiles(catID,subCatID,this.returnRefreshFileList);
	},
	returnRefreshFileList : function (string) {
		var stringArray = string.split('|');
		var catID    = stringArray[0];
		var subCatID = stringArray[1];
		var fileList = stringArray[2];
		
		if (subCatID>0) {
			$('fileListSubCat'+subCatID).innerHTML = fileList;
		} else {
			$('fileList'+catID).innerHTML = fileList;
		}	
	}	
}

var filesDeleteObj = {
	returnDeleteFile : function(string) {
		var stringArray = string.split('|');
		var fID   = stringArray[0];
		var catID = stringArray[1];
		
		var fileRow = 'row'+fID;
		Effect.Fade(fileRow, {delay: .5, duration: 1});	
		
		// Get total files and decrease by 1
		var noOfFiles = parseInt($('noOfFiles'+catID).innerHTML);
		var newNoOfFiles = noOfFiles-1;
		$('noOfFiles'+catID).innerHTML = newNoOfFiles;
	}
}

var filesSupportObj = {
	openAddEditForm : function (catID) {
		var addEditForm = 'addEditForm'+catID;
		new Effect.SlideDown(addEditForm, {direction: 'top', duration: .3});
	},
	closeAddEditForm : function (catID) {
		var addEditForm = 'addEditForm'+catID;
		new Effect.SlideUp(addEditForm, {direction: 'top', duration: .3});
	},
	swapApproved : function (fID) {
		x_swapApproved(fID,this.returnSwapApproved);
	},
	returnSwapApproved : function (string) {
		var stringArray = string.split('|');	
		var fID = stringArray[0];
		var approveString = stringArray[1];
		
		$('approveContainer'+fID).innerHTML = approveString;
	}
}